package com.divine.wn.car.service;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.divine.wn.car.persistence.UserMapper;
import com.divine.wn.car.vo.UserVO;

@Service
public class UserService {
	@Autowired
	private UserMapper userMapper;

	@Transactional
	public Object insertUser(UserVO user) {
		userMapper.insertUser(user);
		return userMapper.getKey();
	}
	
	
	public Float getDkze(){
		return userMapper.getDkze();
	}
	
	@Transactional
	public void updateUser(UserVO user){
		userMapper.updateUser(user);
	}
	
	public int getStatus(HashMap<String,Object> map) {
		return userMapper.getStatus(map);
	}
	
	public void updateStatus(HashMap<String,Object> map) {
		userMapper.updateStatus(map);
	}
	

	public int existUser(String sn) {
		return userMapper.existUser(sn);
	}


	
	public int getdataCount(HashMap<String,Object> map) {
		return userMapper.getdataCount(map);
	}
	
	public List<HashMap<String,Object>> getdatalist(HashMap<String,Object> map) {
		return userMapper.getdatalist(map);
	}
	
	public int getHistoryCount(HashMap<String,Object> map) {
		return userMapper.getHistoryCount(map);
	}
	
	public List<HashMap<String,Object>> getHistoryList(HashMap<String,Object> map) {
		return userMapper.getHistoryList(map);
	}
	
	
	public int getFcCount() {
		return userMapper.getFcCount();
	}
	
	public List<HashMap<String,Object>> getFcList(HashMap<String,Object> map) {
		return userMapper.getFcList(map);
	}
	
	@Transactional
	public void deleteUser(int id) {
		userMapper.deleteUser(id);
		userMapper.deleteLog(id);
		userMapper.deleteWorkflow(id);
		userMapper.deletePay(id);
	}

	public UserVO getUser(int id) {
		return userMapper.getUser(id);
	}
	
	public String getXDY(int id) {
		return userMapper.getXDY(id);
	}
	
	
	@Transactional
	public void updateBX(UserVO user){
		userMapper.updateBX(user);
	}
	
	@Transactional
	public void updateXSZ(UserVO user){
		userMapper.updateXSZ(user);
	}
	
	@Transactional
	public void insertPay(HashMap<String,Object> map){
		userMapper.insertPay(map);
	}
	
	public List<HashMap<String,Object>> getPay(String tableid){
		return userMapper.getPay(tableid);
	}
	
	public int existPay(HashMap<String,Object> map){
		return userMapper.existPay(map);
	}
	
	public List<HashMap<String,Object>> getNotPay(HashMap<String,Object> map){
		return userMapper.getNotPay(map);
	}
	
	public int getNotPayCount(HashMap<String,Object> map){
		return userMapper.getNotPayCount(map);
	}
	
	public void updateDktx(HashMap<String,Object> map){
		 userMapper.updateDktx(map);
	}
	
	public void updateJgtx(HashMap<String,Object> map){
		 userMapper.updateJgtx(map);
	}
	
	public void completeDktx(HashMap<String,Object> map){
		 userMapper.completeDktx(map);
	}
	
	public void updateGPStx(HashMap<String,Object> map){
		 userMapper.updateGPStx(map);
	}
	
	public void updateBzj(HashMap<String,Object> map){
		 userMapper.updateBzj(map);
	}
	
	public void completeGPStx(HashMap<String,Object> map){
		 userMapper.completeGPStx(map);
	}
	
	public void completeGptx(HashMap<String,Object> map){
		 userMapper.completeGptx(map);
	}
	
	public void completeGp2tx(HashMap<String,Object> map){
		 userMapper.completeGp2tx(map);
	}
	
	
	
	public void completeGPS4tx(HashMap<String,Object> map){
		 userMapper.completeGPS4tx(map);
	}
	
	public  List<HashMap<String,Object>> getdktxList(HashMap<String,Object> map){
		return userMapper.getdktxList(map);
	}
	public int getdktxCount (HashMap<String,Object> map){
		return userMapper.getdktxCount(map);
	}
	
	public  List<HashMap<String,Object>> getGPStxList(HashMap<String,Object> map){
		return userMapper.getGPStxList(map);
	}
	public int getGPStxCount (HashMap<String,Object> map){
		return userMapper.getGPStxCount(map);
	}
	
	public  List<HashMap<String,Object>> getFktxList(HashMap<String,Object> map){
		return userMapper.getFktxList(map);
	}
	public int getFktxCount (HashMap<String,Object> map){
		return userMapper.getFktxCount(map);
	}
	
	public void updateFktx(HashMap<String,Object> map){
		 userMapper.updateFktx(map);
	}
	
	public void completeFktx(HashMap<String,Object> map){
		 userMapper.completeFktx(map);
	}

	public int getBXtxCount (HashMap<String,Object> map){
		return userMapper.getBXtxCount(map);
	}
	public List<HashMap<String,Object>> getBXtxList(HashMap<String,Object> map){
		return userMapper.getBXtxList(map);
	}
	
	public int getXStxCount (HashMap<String,Object> map){
		return userMapper.getXStxCount(map);
	}
	
	public List<HashMap<String,Object>> getXStxList(HashMap<String,Object> map){
		return userMapper.getXStxList(map);
	}
	
	public int getYYtxCount(HashMap<String,Object> map){
		return userMapper.getYYtxCount(map);
	}
	public List<HashMap<String,Object>> getYYtxList(HashMap<String,Object> map){
		return userMapper.getYYtxList(map);
	}
	
	
}
